<?php

namespace app\admin\validate;

use think\Validate;

class SellerProduct extends Validate
{
    protected $rule = [
        'id' => 'require|number',
        'ids' => 'require|array',
        'pageIndex' => 'require|number',
        'pageSize' => 'require|number',
        'seller_id' => 'require|number',
        'model_id' =>  'require|number',
        'product_name' =>  'require',
        'status' =>  'require|number',
    ];

    //定义验证提示
    protected $message = [
        'id.require' => 'ID 不能为空',
        'id.number' => 'ID 参数错误',
        'pageIndex.require' => '页码参数不能为空',
        'pageIndex.number' => '页码参数错误',
        'pageSize.require' => '分页条数不能为空',
        'pageSize.number' => '分页条数参数错误',
        'seller_id.require' => '渠道商ID不能为空',
        'seller_id.number' => '渠道商ID参数错误',
        'model_id.require' => '机型ID不能为空',
        'model_id.number' => '机型ID参数错误',
        'status.require' => '状态不能为空',
        'status.number' => '状态参数错误',
        'ids.require' => 'IDs不能为空',
        'ids.array' => 'IDs参数错误',
    ];

    protected $scene = [
        'getList' => ['pageIndex','pageSize','status'],
        'save' => ['model_name'],
        'detail' =>  ['id'],
        'update' => ['id','model_name'],
        'delete' =>  ['ids']
    ];

}
